package pool.errors;

import pool.exceptions.EmptyPoolException;
import pool.test.client.Client;

public class ExceptionHandlerType extends ErrorHandler{

	@Override
	public void handle(String handlerType, Client client) throws EmptyPoolException {
		
		if(handlerType.equals("exception")){
			throw new EmptyPoolException("Sorry " + client.getName() + "  we do not have any available items at the moment..");
		}else if(next != null){
			next.handle(handlerType, client);
		}
		
	}

	@Override
	public void event(String handlerType) {
		
		if(handlerType.equals("exception")){
			System.out.println("No special action...");
		}else if(next != null){
			next.event(handlerType);
		}
		
	}
	
	
	
	

}
